package org.oa.dao.impl;

import java.io.Serializable;

import javax.annotation.Resource;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.oa.dao.OrganizationDao;
import org.oa.dto.Organization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

/**
 * 机构Dao实现类
 * 
 * @author Administrator
 *
 */
@Repository
public class OrganizationDaoImpl extends HibernateDaoSupport implements OrganizationDao{

	@Resource
	public void MySessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}
	
	public Long save(Organization org){
		Session session = currentSession();
		Serializable id = session.save(org);
		return (Long)id;
	}
}
